#ifndef IDINFOCONTAINER_H
#define IDINFOCONTAINER_H

#include <LinkedIdentifierInfo.h>
#include <HeadgenPPCallbacks.h>

#include <clang/Basic/SourceManager.h>
#include <clang/AST/PrettyPrinter.h>

#include <llvm/Support/raw_ostream.h>
#include <llvm/Support/CommandLine.h>

class IdInfoContainer
{
public:
	LinkedIdentifierInfoMap m_idMap;
	LinkedIdentifierInfoList m_idList;
	HeaderInfoMap m_headerMap;

public:
	IdInfoContainer(clang::SourceManager *sm);
	void markUsedIds(const std::list<std::string> &idList);
	void markUsedIds(const llvm::cl::list<std::string> &idList);
	void markUsedId(const std::string &name);
	void markUsedId(LinkedIdentifierInfo *id);

	void print(llvm::raw_ostream &os);
	void printHeaders(llvm::raw_ostream &os);
	void printDecls(llvm::raw_ostream &os);

	void printFunctionPrototype(llvm::raw_ostream &os, clang::FunctionDecl *D);
	void printVarDecl(llvm::raw_ostream &os, clang::VarDecl *D);
	void printExternVarDecl(llvm::raw_ostream &os, clang::VarDecl *D);

private:
	clang::SourceManager *m_sm;
	clang::PrintingPolicy m_printingPolicy;
};

#endif // IDINFOCONTAINER_H
